//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension Synthetics {
    // MARK: Enums

    public enum CanaryRunState: String, CustomStringConvertible, Codable, _SotoSendable {
        case failed = "FAILED"
        case passed = "PASSED"
        case running = "RUNNING"
        public var description: String { return self.rawValue }
    }

    public enum CanaryRunStateReasonCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case canaryFailure = "CANARY_FAILURE"
        case executionFailure = "EXECUTION_FAILURE"
        public var description: String { return self.rawValue }
    }

    public enum CanaryState: String, CustomStringConvertible, Codable, _SotoSendable {
        case creating = "CREATING"
        case deleting = "DELETING"
        case error = "ERROR"
        case ready = "READY"
        case running = "RUNNING"
        case starting = "STARTING"
        case stopped = "STOPPED"
        case stopping = "STOPPING"
        case updating = "UPDATING"
        public var description: String { return self.rawValue }
    }

    public enum CanaryStateReasonCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case createFailed = "CREATE_FAILED"
        case createInProgress = "CREATE_IN_PROGRESS"
        case createPending = "CREATE_PENDING"
        case deleteFailed = "DELETE_FAILED"
        case deleteInProgress = "DELETE_IN_PROGRESS"
        case invalidPermissions = "INVALID_PERMISSIONS"
        case rollbackComplete = "ROLLBACK_COMPLETE"
        case rollbackFailed = "ROLLBACK_FAILED"
        case syncDeleteInProgress = "SYNC_DELETE_IN_PROGRESS"
        case updateComplete = "UPDATE_COMPLETE"
        case updateInProgress = "UPDATE_IN_PROGRESS"
        case updatePending = "UPDATE_PENDING"
        public var description: String { return self.rawValue }
    }

    public enum EncryptionMode: String, CustomStringConvertible, Codable, _SotoSendable {
        case sseKms = "SSE_KMS"
        case sseS3 = "SSE_S3"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct ArtifactConfigInput: AWSEncodableShape {
        /// A structure that contains the configuration of the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.  Artifact encryption functionality is available only for canaries that use Synthetics runtime version  syn-nodejs-puppeteer-3.3 or later. For more information, see Encrypting canary artifacts
        public let s3Encryption: S3EncryptionConfig?

        public init(s3Encryption: S3EncryptionConfig? = nil) {
            self.s3Encryption = s3Encryption
        }

        public func validate(name: String) throws {
            try self.s3Encryption?.validate(name: "\(name).s3Encryption")
        }

        private enum CodingKeys: String, CodingKey {
            case s3Encryption = "S3Encryption"
        }
    }

    public struct ArtifactConfigOutput: AWSDecodableShape {
        /// A structure that contains the configuration of encryption settings for canary artifacts that are stored in Amazon S3.
        public let s3Encryption: S3EncryptionConfig?

        public init(s3Encryption: S3EncryptionConfig? = nil) {
            self.s3Encryption = s3Encryption
        }

        private enum CodingKeys: String, CodingKey {
            case s3Encryption = "S3Encryption"
        }
    }

    public struct AssociateResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "groupIdentifier", location: .uri("GroupIdentifier"))
        ]

        /// Specifies the group. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
        public let groupIdentifier: String
        /// The ARN of the canary that you want to associate with the specified group.
        public let resourceArn: String

        public init(groupIdentifier: String, resourceArn: String) {
            self.groupIdentifier = groupIdentifier
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, max: 128)
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:canary:[0-9a-z_\\-]{1,21}$")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
        }
    }

    public struct AssociateResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct BaseScreenshot: AWSEncodableShape & AWSDecodableShape {
        /// Coordinates that define the part of a screen to ignore during screenshot comparisons. To obtain the  coordinates to use here, use the  CloudWatch console to draw the boundaries on the screen. For more information, see   Editing or deleting a canary
        public let ignoreCoordinates: [String]?
        /// The name of the screenshot. This is generated the first time the canary is run after the UpdateCanary operation that specified for this canary to perform visual monitoring.
        public let screenshotName: String

        public init(ignoreCoordinates: [String]? = nil, screenshotName: String) {
            self.ignoreCoordinates = ignoreCoordinates
            self.screenshotName = screenshotName
        }

        public func validate(name: String) throws {
            try self.ignoreCoordinates?.forEach {
                try validate($0, name: "ignoreCoordinates[]", parent: name, pattern: "^(-?\\d{1,5}\\.?\\d{0,2},){3}(-?\\d{1,5}\\.?\\d{0,2}){1}$")
            }
            try self.validate(self.ignoreCoordinates, name: "ignoreCoordinates", parent: name, max: 20)
            try self.validate(self.screenshotName, name: "screenshotName", parent: name, max: 1024)
            try self.validate(self.screenshotName, name: "screenshotName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case ignoreCoordinates = "IgnoreCoordinates"
            case screenshotName = "ScreenshotName"
        }
    }

    public struct Canary: AWSDecodableShape {
        /// A structure that contains the configuration for canary artifacts, including  the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.
        public let artifactConfig: ArtifactConfigOutput?
        /// The location in Amazon S3 where Synthetics stores artifacts from the runs of this canary. Artifacts include the log file, screenshots, and HAR files.
        public let artifactS3Location: String?
        public let code: CanaryCodeOutput?
        /// The ARN of the Lambda function that is used as your canary's engine. For more information  about Lambda ARN format, see Resources and Conditions for Lambda Actions.
        public let engineArn: String?
        /// The ARN of the IAM role used to run the canary. This role must include lambda.amazonaws.com as a principal in the trust policy.
        public let executionRoleArn: String?
        /// The number of days to retain data about failed runs of this canary.
        public let failureRetentionPeriodInDays: Int?
        /// The unique ID of this canary.
        public let id: String?
        /// The name of the canary.
        public let name: String?
        public let runConfig: CanaryRunConfigOutput?
        /// Specifies the runtime version to use for the canary. For more information about runtime versions, see  Canary Runtime Versions.
        public let runtimeVersion: String?
        /// A structure that contains information about how often the canary is to run, and when these runs are to stop.
        public let schedule: CanaryScheduleOutput?
        /// A structure that contains information about the canary's status.
        public let status: CanaryStatus?
        /// The number of days to retain data about successful runs of this canary.
        public let successRetentionPeriodInDays: Int?
        /// The list of key-value pairs that are associated with the canary.
        public let tags: [String: String]?
        /// A structure that contains information about when the canary was created, modified, and most recently run.
        public let timeline: CanaryTimeline?
        /// If this canary performs visual monitoring by comparing screenshots, this structure contains the ID of the canary run to use as the baseline for screenshots, and the coordinates of any parts of the screen to ignore during the visual monitoring comparison.
        public let visualReference: VisualReferenceOutput?
        public let vpcConfig: VpcConfigOutput?

        public init(artifactConfig: ArtifactConfigOutput? = nil, artifactS3Location: String? = nil, code: CanaryCodeOutput? = nil, engineArn: String? = nil, executionRoleArn: String? = nil, failureRetentionPeriodInDays: Int? = nil, id: String? = nil, name: String? = nil, runConfig: CanaryRunConfigOutput? = nil, runtimeVersion: String? = nil, schedule: CanaryScheduleOutput? = nil, status: CanaryStatus? = nil, successRetentionPeriodInDays: Int? = nil, tags: [String: String]? = nil, timeline: CanaryTimeline? = nil, visualReference: VisualReferenceOutput? = nil, vpcConfig: VpcConfigOutput? = nil) {
            self.artifactConfig = artifactConfig
            self.artifactS3Location = artifactS3Location
            self.code = code
            self.engineArn = engineArn
            self.executionRoleArn = executionRoleArn
            self.failureRetentionPeriodInDays = failureRetentionPeriodInDays
            self.id = id
            self.name = name
            self.runConfig = runConfig
            self.runtimeVersion = runtimeVersion
            self.schedule = schedule
            self.status = status
            self.successRetentionPeriodInDays = successRetentionPeriodInDays
            self.tags = tags
            self.timeline = timeline
            self.visualReference = visualReference
            self.vpcConfig = vpcConfig
        }

        private enum CodingKeys: String, CodingKey {
            case artifactConfig = "ArtifactConfig"
            case artifactS3Location = "ArtifactS3Location"
            case code = "Code"
            case engineArn = "EngineArn"
            case executionRoleArn = "ExecutionRoleArn"
            case failureRetentionPeriodInDays = "FailureRetentionPeriodInDays"
            case id = "Id"
            case name = "Name"
            case runConfig = "RunConfig"
            case runtimeVersion = "RuntimeVersion"
            case schedule = "Schedule"
            case status = "Status"
            case successRetentionPeriodInDays = "SuccessRetentionPeriodInDays"
            case tags = "Tags"
            case timeline = "Timeline"
            case visualReference = "VisualReference"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct CanaryCodeInput: AWSEncodableShape {
        /// The entry point to use for the source code when running the canary. For canaries that use the  syn-python-selenium-1.0 runtime or a syn-nodejs.puppeteer runtime earlier than syn-nodejs.puppeteer-3.4,  the handler must be specified as  fileName.handler. For  syn-python-selenium-1.1, syn-nodejs.puppeteer-3.4, and later runtimes, the handler can be specified as   fileName.functionName , or you can specify a folder where canary scripts reside as
        ///  folder/fileName.functionName .
        public let handler: String
        /// If your canary script is located in S3, specify the bucket name here. Do not include s3:// as the  start of the bucket name.
        public let s3Bucket: String?
        /// The S3 key of your script. For more information, see Working with Amazon S3 Objects.
        public let s3Key: String?
        /// The S3 version ID of your script.
        public let s3Version: String?
        /// If you input your canary script directly into the canary instead of referring to an S3 location, the value of this parameter is the base64-encoded contents of the .zip file that  contains the script. It must be smaller than 225 Kb. For large canary scripts, we recommend that you use an S3 location instead of inputting it  directly with this parameter.
        public let zipFile: AWSBase64Data?

        public init(handler: String, s3Bucket: String? = nil, s3Key: String? = nil, s3Version: String? = nil, zipFile: AWSBase64Data? = nil) {
            self.handler = handler
            self.s3Bucket = s3Bucket
            self.s3Key = s3Key
            self.s3Version = s3Version
            self.zipFile = zipFile
        }

        public func validate(name: String) throws {
            try self.validate(self.handler, name: "handler", parent: name, max: 128)
            try self.validate(self.handler, name: "handler", parent: name, min: 1)
            try self.validate(self.handler, name: "handler", parent: name, pattern: "^([0-9a-zA-Z_-]+\\/)*[0-9A-Za-z_\\\\-]+\\.[A-Za-z_][A-Za-z0-9_]*$")
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, max: 1024)
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, min: 1)
            try self.validate(self.s3Key, name: "s3Key", parent: name, max: 1024)
            try self.validate(self.s3Key, name: "s3Key", parent: name, min: 1)
            try self.validate(self.s3Version, name: "s3Version", parent: name, max: 1024)
            try self.validate(self.s3Version, name: "s3Version", parent: name, min: 1)
            try self.validate(self.zipFile, name: "zipFile", parent: name, max: 10_000_000)
            try self.validate(self.zipFile, name: "zipFile", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case handler = "Handler"
            case s3Bucket = "S3Bucket"
            case s3Key = "S3Key"
            case s3Version = "S3Version"
            case zipFile = "ZipFile"
        }
    }

    public struct CanaryCodeOutput: AWSDecodableShape {
        /// The entry point to use for the source code when running the canary.
        public let handler: String?
        /// The ARN of the Lambda layer where Synthetics stores the canary script code.
        public let sourceLocationArn: String?

        public init(handler: String? = nil, sourceLocationArn: String? = nil) {
            self.handler = handler
            self.sourceLocationArn = sourceLocationArn
        }

        private enum CodingKeys: String, CodingKey {
            case handler = "Handler"
            case sourceLocationArn = "SourceLocationArn"
        }
    }

    public struct CanaryLastRun: AWSDecodableShape {
        /// The name of the canary.
        public let canaryName: String?
        /// The results from this canary's most recent run.
        public let lastRun: CanaryRun?

        public init(canaryName: String? = nil, lastRun: CanaryRun? = nil) {
            self.canaryName = canaryName
            self.lastRun = lastRun
        }

        private enum CodingKeys: String, CodingKey {
            case canaryName = "CanaryName"
            case lastRun = "LastRun"
        }
    }

    public struct CanaryRun: AWSDecodableShape {
        /// The location where the canary stored artifacts from the run. Artifacts include  the log file, screenshots, and HAR files.
        public let artifactS3Location: String?
        /// A unique ID that identifies this canary run.
        public let id: String?
        /// The name of the canary.
        public let name: String?
        /// The status of this run.
        public let status: CanaryRunStatus?
        /// A structure that contains the start and end times of this run.
        public let timeline: CanaryRunTimeline?

        public init(artifactS3Location: String? = nil, id: String? = nil, name: String? = nil, status: CanaryRunStatus? = nil, timeline: CanaryRunTimeline? = nil) {
            self.artifactS3Location = artifactS3Location
            self.id = id
            self.name = name
            self.status = status
            self.timeline = timeline
        }

        private enum CodingKeys: String, CodingKey {
            case artifactS3Location = "ArtifactS3Location"
            case id = "Id"
            case name = "Name"
            case status = "Status"
            case timeline = "Timeline"
        }
    }

    public struct CanaryRunConfigInput: AWSEncodableShape {
        /// Specifies whether this canary is to use active X-Ray tracing when it runs. Active tracing  enables this canary run to be displayed in the ServiceLens and X-Ray service maps even if the canary does  not hit an endpoint that has X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see   Canaries and X-Ray tracing. You can enable active tracing only for canaries that use version syn-nodejs-2.0  or later for their canary runtime.
        public let activeTracing: Bool?
        /// Specifies the keys and values to use for any environment variables used in the canary script. Use the following format: { "key1" : "value1", "key2" : "value2", ...} Keys must start with a letter and be at least two characters. The total size of your environment variables cannot exceed 4 KB. You can't specify any Lambda reserved environment variables as the keys for your environment variables. For  more information about reserved keys, see  Runtime environment variables.  The environment variables keys and values are not encrypted. Do not store sensitive information in this field.
        public let environmentVariables: [String: String]?
        /// The maximum amount of memory available to the canary while it is running, in MB. This value must be a multiple of 64.
        public let memoryInMB: Int?
        /// How long the canary is allowed to run before it must stop. You can't set this time to be longer than the frequency of the runs of this canary. If you omit this field, the frequency of the canary is used as this value, up to a maximum of 14 minutes.
        public let timeoutInSeconds: Int?

        public init(activeTracing: Bool? = nil, environmentVariables: [String: String]? = nil, memoryInMB: Int? = nil, timeoutInSeconds: Int? = nil) {
            self.activeTracing = activeTracing
            self.environmentVariables = environmentVariables
            self.memoryInMB = memoryInMB
            self.timeoutInSeconds = timeoutInSeconds
        }

        public func validate(name: String) throws {
            try self.environmentVariables?.forEach {
                try validate($0.key, name: "environmentVariables.key", parent: name, pattern: "^[a-zA-Z]([a-zA-Z0-9_])+$")
            }
            try self.validate(self.memoryInMB, name: "memoryInMB", parent: name, max: 3008)
            try self.validate(self.memoryInMB, name: "memoryInMB", parent: name, min: 960)
            try self.validate(self.timeoutInSeconds, name: "timeoutInSeconds", parent: name, max: 840)
            try self.validate(self.timeoutInSeconds, name: "timeoutInSeconds", parent: name, min: 3)
        }

        private enum CodingKeys: String, CodingKey {
            case activeTracing = "ActiveTracing"
            case environmentVariables = "EnvironmentVariables"
            case memoryInMB = "MemoryInMB"
            case timeoutInSeconds = "TimeoutInSeconds"
        }
    }

    public struct CanaryRunConfigOutput: AWSDecodableShape {
        /// Displays whether this canary run used active X-Ray tracing.
        public let activeTracing: Bool?
        /// The maximum amount of memory available to the canary while it is running, in MB. This value must be a multiple of 64.
        public let memoryInMB: Int?
        /// How long the canary is allowed to run before it must stop.
        public let timeoutInSeconds: Int?

        public init(activeTracing: Bool? = nil, memoryInMB: Int? = nil, timeoutInSeconds: Int? = nil) {
            self.activeTracing = activeTracing
            self.memoryInMB = memoryInMB
            self.timeoutInSeconds = timeoutInSeconds
        }

        private enum CodingKeys: String, CodingKey {
            case activeTracing = "ActiveTracing"
            case memoryInMB = "MemoryInMB"
            case timeoutInSeconds = "TimeoutInSeconds"
        }
    }

    public struct CanaryRunStatus: AWSDecodableShape {
        /// The current state of the run.
        public let state: CanaryRunState?
        /// If run of the canary failed, this field contains the reason for the error.
        public let stateReason: String?
        /// If this value is CANARY_FAILURE, an exception occurred in the  canary code. If this value is EXECUTION_FAILURE, an exception occurred in  CloudWatch Synthetics.
        public let stateReasonCode: CanaryRunStateReasonCode?

        public init(state: CanaryRunState? = nil, stateReason: String? = nil, stateReasonCode: CanaryRunStateReasonCode? = nil) {
            self.state = state
            self.stateReason = stateReason
            self.stateReasonCode = stateReasonCode
        }

        private enum CodingKeys: String, CodingKey {
            case state = "State"
            case stateReason = "StateReason"
            case stateReasonCode = "StateReasonCode"
        }
    }

    public struct CanaryRunTimeline: AWSDecodableShape {
        /// The end time of the run.
        public let completed: Date?
        /// The start time of the run.
        public let started: Date?

        public init(completed: Date? = nil, started: Date? = nil) {
            self.completed = completed
            self.started = started
        }

        private enum CodingKeys: String, CodingKey {
            case completed = "Completed"
            case started = "Started"
        }
    }

    public struct CanaryScheduleInput: AWSEncodableShape {
        /// How long, in seconds, for the canary to continue making regular runs according to the schedule in the Expression value. If you specify 0, the canary continues making runs until you stop it. If you omit this field, the default of 0 is used.
        public let durationInSeconds: Int64?
        /// A rate expression or a cron expression that defines how often the canary is to run. For a rate expression, The syntax is rate(number unit). unit can be minute, minutes, or hour.  For example, rate(1 minute) runs the canary once a minute, rate(10 minutes) runs it once every  10 minutes, and rate(1 hour) runs it once every hour. You can specify a frequency between rate(1 minute) and rate(1 hour). Specifying rate(0 minute) or rate(0 hour) is a special value  that causes the  canary to run only once when it is started. Use cron(expression) to specify a cron  expression. You can't schedule a canary to wait for more than a year before running. For information about the syntax for cron expressions, see   Scheduling canary runs using cron.
        public let expression: String

        public init(durationInSeconds: Int64? = nil, expression: String) {
            self.durationInSeconds = durationInSeconds
            self.expression = expression
        }

        public func validate(name: String) throws {
            try self.validate(self.durationInSeconds, name: "durationInSeconds", parent: name, max: 31_622_400)
            try self.validate(self.durationInSeconds, name: "durationInSeconds", parent: name, min: 0)
            try self.validate(self.expression, name: "expression", parent: name, max: 1024)
            try self.validate(self.expression, name: "expression", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case durationInSeconds = "DurationInSeconds"
            case expression = "Expression"
        }
    }

    public struct CanaryScheduleOutput: AWSDecodableShape {
        /// How long, in seconds, for the canary to continue making regular runs after it  was created. The runs are performed according to the schedule in the  Expression value.
        public let durationInSeconds: Int64?
        /// A rate expression or a cron expression that defines how often the canary is to run. For a rate expression, The syntax is rate(number unit). unit can be minute, minutes, or hour.  For example, rate(1 minute) runs the canary once a minute, rate(10 minutes) runs it once every  10 minutes, and rate(1 hour) runs it once every hour. You can specify a frequency between rate(1 minute) and rate(1 hour). Specifying rate(0 minute) or rate(0 hour) is a special value  that causes the  canary to run only once when it is started. Use cron(expression) to specify a cron  expression. For information about the syntax for cron expressions, see   Scheduling canary runs using cron.
        public let expression: String?

        public init(durationInSeconds: Int64? = nil, expression: String? = nil) {
            self.durationInSeconds = durationInSeconds
            self.expression = expression
        }

        private enum CodingKeys: String, CodingKey {
            case durationInSeconds = "DurationInSeconds"
            case expression = "Expression"
        }
    }

    public struct CanaryStatus: AWSDecodableShape {
        /// The current state of the canary.
        public let state: CanaryState?
        /// If the canary has insufficient permissions to run, this field provides more details.
        public let stateReason: String?
        /// If the canary cannot run or has failed, this field displays the reason.
        public let stateReasonCode: CanaryStateReasonCode?

        public init(state: CanaryState? = nil, stateReason: String? = nil, stateReasonCode: CanaryStateReasonCode? = nil) {
            self.state = state
            self.stateReason = stateReason
            self.stateReasonCode = stateReasonCode
        }

        private enum CodingKeys: String, CodingKey {
            case state = "State"
            case stateReason = "StateReason"
            case stateReasonCode = "StateReasonCode"
        }
    }

    public struct CanaryTimeline: AWSDecodableShape {
        /// The date and time the canary was created.
        public let created: Date?
        /// The date and time the canary was most recently modified.
        public let lastModified: Date?
        /// The date and time that the canary's most recent run started.
        public let lastStarted: Date?
        /// The date and time that the canary's most recent run ended.
        public let lastStopped: Date?

        public init(created: Date? = nil, lastModified: Date? = nil, lastStarted: Date? = nil, lastStopped: Date? = nil) {
            self.created = created
            self.lastModified = lastModified
            self.lastStarted = lastStarted
            self.lastStopped = lastStopped
        }

        private enum CodingKeys: String, CodingKey {
            case created = "Created"
            case lastModified = "LastModified"
            case lastStarted = "LastStarted"
            case lastStopped = "LastStopped"
        }
    }

    public struct CreateCanaryRequest: AWSEncodableShape {
        /// A structure that contains the configuration for canary artifacts, including  the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.
        public let artifactConfig: ArtifactConfigInput?
        /// The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. Artifacts include the log file, screenshots, and HAR files.  The name of the  S3 bucket can't include a period (.).
        public let artifactS3Location: String
        /// A structure that includes the entry point from which the canary should start running your script. If the script is stored in  an S3 bucket, the bucket name, key, and version are also included.
        public let code: CanaryCodeInput
        /// The ARN of the IAM role to be used to run the canary. This role must already exist,  and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:    s3:PutObject     s3:GetBucketLocation     s3:ListAllMyBuckets     cloudwatch:PutMetricData     logs:CreateLogGroup     logs:CreateLogStream     logs:PutLogEvents
        public let executionRoleArn: String
        /// The number of days to retain data about failed runs of this canary. If you omit  this field, the default of 31 days is used. The valid range is 1 to 455 days.
        public let failureRetentionPeriodInDays: Int?
        /// The name for this canary. Be sure to give it a descriptive name  that distinguishes it from other canaries in your account. Do not include secrets or proprietary information in your canary names. The canary name makes up part of the canary ARN, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries.
        public let name: String
        /// A structure that contains the configuration for individual canary runs,  such as timeout value and environment variables.  The environment variables keys and values are not encrypted. Do not store sensitive information in this field.
        public let runConfig: CanaryRunConfigInput?
        /// Specifies the runtime version to use for the canary. For a list of valid runtime versions and more information about runtime versions, see  Canary Runtime Versions.
        public let runtimeVersion: String
        /// A structure that contains information about how often the canary is to run and when these test runs are to stop.
        public let schedule: CanaryScheduleInput
        /// The number of days to retain data about successful runs of this canary. If you omit  this field, the default of 31 days is used. The valid range is 1 to 455 days.
        public let successRetentionPeriodInDays: Int?
        /// A list of key-value pairs to associate with the canary.  You can associate as many as 50 tags with a canary. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by  granting a user permission to access or change only the resources that have certain tag values.
        public let tags: [String: String]?
        /// If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint.  For more information, see  Running a Canary in a VPC.
        public let vpcConfig: VpcConfigInput?

        public init(artifactConfig: ArtifactConfigInput? = nil, artifactS3Location: String, code: CanaryCodeInput, executionRoleArn: String, failureRetentionPeriodInDays: Int? = nil, name: String, runConfig: CanaryRunConfigInput? = nil, runtimeVersion: String, schedule: CanaryScheduleInput, successRetentionPeriodInDays: Int? = nil, tags: [String: String]? = nil, vpcConfig: VpcConfigInput? = nil) {
            self.artifactConfig = artifactConfig
            self.artifactS3Location = artifactS3Location
            self.code = code
            self.executionRoleArn = executionRoleArn
            self.failureRetentionPeriodInDays = failureRetentionPeriodInDays
            self.name = name
            self.runConfig = runConfig
            self.runtimeVersion = runtimeVersion
            self.schedule = schedule
            self.successRetentionPeriodInDays = successRetentionPeriodInDays
            self.tags = tags
            self.vpcConfig = vpcConfig
        }

        public func validate(name: String) throws {
            try self.artifactConfig?.validate(name: "\(name).artifactConfig")
            try self.validate(self.artifactS3Location, name: "artifactS3Location", parent: name, max: 1024)
            try self.validate(self.artifactS3Location, name: "artifactS3Location", parent: name, min: 1)
            try self.code.validate(name: "\(name).code")
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, max: 2048)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, min: 1)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$")
            try self.validate(self.failureRetentionPeriodInDays, name: "failureRetentionPeriodInDays", parent: name, max: 1024)
            try self.validate(self.failureRetentionPeriodInDays, name: "failureRetentionPeriodInDays", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 21)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
            try self.runConfig?.validate(name: "\(name).runConfig")
            try self.validate(self.runtimeVersion, name: "runtimeVersion", parent: name, max: 1024)
            try self.validate(self.runtimeVersion, name: "runtimeVersion", parent: name, min: 1)
            try self.schedule.validate(name: "\(name).schedule")
            try self.validate(self.successRetentionPeriodInDays, name: "successRetentionPeriodInDays", parent: name, max: 1024)
            try self.validate(self.successRetentionPeriodInDays, name: "successRetentionPeriodInDays", parent: name, min: 1)
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
            try self.vpcConfig?.validate(name: "\(name).vpcConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case artifactConfig = "ArtifactConfig"
            case artifactS3Location = "ArtifactS3Location"
            case code = "Code"
            case executionRoleArn = "ExecutionRoleArn"
            case failureRetentionPeriodInDays = "FailureRetentionPeriodInDays"
            case name = "Name"
            case runConfig = "RunConfig"
            case runtimeVersion = "RuntimeVersion"
            case schedule = "Schedule"
            case successRetentionPeriodInDays = "SuccessRetentionPeriodInDays"
            case tags = "Tags"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct CreateCanaryResponse: AWSDecodableShape {
        /// The full details about the canary you have created.
        public let canary: Canary?

        public init(canary: Canary? = nil) {
            self.canary = canary
        }

        private enum CodingKeys: String, CodingKey {
            case canary = "Canary"
        }
    }

    public struct CreateGroupRequest: AWSEncodableShape {
        /// The name for the group. It can include any Unicode characters. The names for all groups in your account, across all Regions, must be unique.
        public let name: String
        /// A list of key-value pairs to associate with the group.  You can associate as many as 50 tags with a group. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by  granting a user permission to access or change only the resources that have certain tag values.
        public let tags: [String: String]?

        public init(name: String, tags: [String: String]? = nil) {
            self.name = name
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case tags = "Tags"
        }
    }

    public struct CreateGroupResponse: AWSDecodableShape {
        /// A structure that contains information about the group that was just created.
        public let group: Group?

        public init(group: Group? = nil) {
            self.group = group
        }

        private enum CodingKeys: String, CodingKey {
            case group = "Group"
        }
    }

    public struct DeleteCanaryRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "deleteLambda", location: .querystring("deleteLambda")),
            AWSMemberEncoding(label: "name", location: .uri("Name"))
        ]

        /// Specifies whether to also delete the Lambda functions and layers used by this canary. The default is false. Type: Boolean
        public let deleteLambda: Bool?
        /// The name of the canary that you want to delete. To find the names of your canaries, use DescribeCanaries.
        public let name: String

        public init(deleteLambda: Bool? = nil, name: String) {
            self.deleteLambda = deleteLambda
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 21)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteCanaryResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteGroupRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "groupIdentifier", location: .uri("GroupIdentifier"))
        ]

        /// Specifies which group to delete. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
        public let groupIdentifier: String

        public init(groupIdentifier: String) {
            self.groupIdentifier = groupIdentifier
        }

        public func validate(name: String) throws {
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, max: 128)
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteGroupResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DescribeCanariesLastRunRequest: AWSEncodableShape {
        /// Specify this parameter to limit how many runs are returned each time you use the DescribeLastRun operation. If you omit this parameter, the default of 100 is used.
        public let maxResults: Int?
        /// Use this parameter to return only canaries that match the names that you specify here. You can specify as many as five canary names. If you specify this parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use the Names parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
        public let names: [String]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent DescribeCanariesLastRun operation to retrieve the next  set of results.
        public let nextToken: String?

        public init(maxResults: Int? = nil, names: [String]? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.names = names
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.names?.forEach {
                try validate($0, name: "names[]", parent: name, max: 21)
                try validate($0, name: "names[]", parent: name, min: 1)
                try validate($0, name: "names[]", parent: name, pattern: "^[0-9a-z_\\-]+$")
            }
            try self.validate(self.names, name: "names", parent: name, max: 5)
            try self.validate(self.names, name: "names", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 252)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case names = "Names"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeCanariesLastRunResponse: AWSDecodableShape {
        /// An array that contains the information from the most recent run of each canary.
        public let canariesLastRun: [CanaryLastRun]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent DescribeCanariesLastRun operation to retrieve the next  set of results.
        public let nextToken: String?

        public init(canariesLastRun: [CanaryLastRun]? = nil, nextToken: String? = nil) {
            self.canariesLastRun = canariesLastRun
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case canariesLastRun = "CanariesLastRun"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeCanariesRequest: AWSEncodableShape {
        /// Specify this parameter to limit how many canaries are returned each time you use the DescribeCanaries operation. If you omit this parameter, the default of 100 is used.
        public let maxResults: Int?
        /// Use this parameter to return only canaries that match the names that you specify here. You can specify as many as five canary names. If you specify this parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use this parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
        public let names: [String]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
        public let nextToken: String?

        public init(maxResults: Int? = nil, names: [String]? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.names = names
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.names?.forEach {
                try validate($0, name: "names[]", parent: name, max: 21)
                try validate($0, name: "names[]", parent: name, min: 1)
                try validate($0, name: "names[]", parent: name, pattern: "^[0-9a-z_\\-]+$")
            }
            try self.validate(self.names, name: "names", parent: name, max: 5)
            try self.validate(self.names, name: "names", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 252)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case names = "Names"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeCanariesResponse: AWSDecodableShape {
        /// Returns an array. Each item in the array contains the full information about one canary.
        public let canaries: [Canary]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent DescribeCanaries operation to retrieve the next  set of results.
        public let nextToken: String?

        public init(canaries: [Canary]? = nil, nextToken: String? = nil) {
            self.canaries = canaries
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case canaries = "Canaries"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeRuntimeVersionsRequest: AWSEncodableShape {
        /// Specify this parameter to limit how many runs are returned each time you use the DescribeRuntimeVersions operation. If you omit this parameter, the default of 100 is used.
        public let maxResults: Int?
        /// A token that indicates that there is more data available. You can use this token in a subsequent DescribeRuntimeVersions operation to retrieve the next  set of results.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 252)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeRuntimeVersionsResponse: AWSDecodableShape {
        /// A token that indicates that there is more data available. You can use this token in a subsequent DescribeRuntimeVersions operation to retrieve the next  set of results.
        public let nextToken: String?
        /// An array of objects that display the details about each Synthetics canary runtime version.
        public let runtimeVersions: [RuntimeVersion]?

        public init(nextToken: String? = nil, runtimeVersions: [RuntimeVersion]? = nil) {
            self.nextToken = nextToken
            self.runtimeVersions = runtimeVersions
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case runtimeVersions = "RuntimeVersions"
        }
    }

    public struct DisassociateResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "groupIdentifier", location: .uri("GroupIdentifier"))
        ]

        /// Specifies the group. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
        public let groupIdentifier: String
        /// The ARN of the canary that you want to remove from the specified group.
        public let resourceArn: String

        public init(groupIdentifier: String, resourceArn: String) {
            self.groupIdentifier = groupIdentifier
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, max: 128)
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:canary:[0-9a-z_\\-]{1,21}$")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
        }
    }

    public struct DisassociateResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct GetCanaryRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "name", location: .uri("Name"))
        ]

        /// The name of the canary that you want details for.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 21)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetCanaryResponse: AWSDecodableShape {
        /// A structure that contains the full information about the canary.
        public let canary: Canary?

        public init(canary: Canary? = nil) {
            self.canary = canary
        }

        private enum CodingKeys: String, CodingKey {
            case canary = "Canary"
        }
    }

    public struct GetCanaryRunsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "name", location: .uri("Name"))
        ]

        /// Specify this parameter to limit how many runs are returned each time you use the GetCanaryRuns operation. If you omit this parameter, the default of 100 is used.
        public let maxResults: Int?
        /// The name of the canary that you want to see runs for.
        public let name: String
        /// A token that indicates that there is more data available. You can use this token in a subsequent GetCanaryRuns operation to retrieve the next  set of results.
        public let nextToken: String?

        public init(maxResults: Int? = nil, name: String, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.name = name
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 21)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 252)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct GetCanaryRunsResponse: AWSDecodableShape {
        /// An array of structures. Each structure contains the details of one of the  retrieved canary runs.
        public let canaryRuns: [CanaryRun]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent GetCanaryRuns  operation to retrieve the next  set of results.
        public let nextToken: String?

        public init(canaryRuns: [CanaryRun]? = nil, nextToken: String? = nil) {
            self.canaryRuns = canaryRuns
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case canaryRuns = "CanaryRuns"
            case nextToken = "NextToken"
        }
    }

    public struct GetGroupRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "groupIdentifier", location: .uri("GroupIdentifier"))
        ]

        /// Specifies the group to return information for. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
        public let groupIdentifier: String

        public init(groupIdentifier: String) {
            self.groupIdentifier = groupIdentifier
        }

        public func validate(name: String) throws {
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, max: 128)
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetGroupResponse: AWSDecodableShape {
        /// A structure that contains information about the group.
        public let group: Group?

        public init(group: Group? = nil) {
            self.group = group
        }

        private enum CodingKeys: String, CodingKey {
            case group = "Group"
        }
    }

    public struct Group: AWSDecodableShape {
        /// The ARN of the group.
        public let arn: String?
        /// The date and time that the group was created.
        public let createdTime: Date?
        /// The unique ID of the group.
        public let id: String?
        /// The date and time that the group was most recently updated.
        public let lastModifiedTime: Date?
        /// The name of the group.
        public let name: String?
        /// The list of key-value pairs that are associated with the canary.
        public let tags: [String: String]?

        public init(arn: String? = nil, createdTime: Date? = nil, id: String? = nil, lastModifiedTime: Date? = nil, name: String? = nil, tags: [String: String]? = nil) {
            self.arn = arn
            self.createdTime = createdTime
            self.id = id
            self.lastModifiedTime = lastModifiedTime
            self.name = name
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case createdTime = "CreatedTime"
            case id = "Id"
            case lastModifiedTime = "LastModifiedTime"
            case name = "Name"
            case tags = "Tags"
        }
    }

    public struct GroupSummary: AWSDecodableShape {
        /// The ARN of the group.
        public let arn: String?
        /// The unique ID of the group.
        public let id: String?
        /// The name of the group.
        public let name: String?

        public init(arn: String? = nil, id: String? = nil, name: String? = nil) {
            self.arn = arn
            self.id = id
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case id = "Id"
            case name = "Name"
        }
    }

    public struct ListAssociatedGroupsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn"))
        ]

        /// Specify this parameter to limit how many groups are returned each time you use the ListAssociatedGroups operation. If you omit this parameter, the default of 20 is used.
        public let maxResults: Int?
        /// A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
        public let nextToken: String?
        /// The ARN of the canary that you want to view groups for.
        public let resourceArn: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, resourceArn: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 512)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^.+$")
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:canary:[0-9a-z_\\-]{1,21}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListAssociatedGroupsResponse: AWSDecodableShape {
        /// An array of structures that contain information about the groups that this canary is associated with.
        public let groups: [GroupSummary]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent ListAssociatedGroups operation to retrieve the next  set of results.
        public let nextToken: String?

        public init(groups: [GroupSummary]? = nil, nextToken: String? = nil) {
            self.groups = groups
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case groups = "Groups"
            case nextToken = "NextToken"
        }
    }

    public struct ListGroupResourcesRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "groupIdentifier", location: .uri("GroupIdentifier"))
        ]

        /// Specifies the group to return information for. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
        public let groupIdentifier: String
        /// Specify this parameter to limit how many canary ARNs are returned each time you use the ListGroupResources operation. If you omit this parameter, the default of 20 is used.
        public let maxResults: Int?
        /// A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
        public let nextToken: String?

        public init(groupIdentifier: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.groupIdentifier = groupIdentifier
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, max: 128)
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, min: 1)
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 512)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^.+$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListGroupResourcesResponse: AWSDecodableShape {
        /// A token that indicates that there is more data available. You can use this token in a subsequent ListGroupResources operation to retrieve the next  set of results.
        public let nextToken: String?
        /// An array of ARNs. These ARNs are for the canaries that are associated with the group.
        public let resources: [String]?

        public init(nextToken: String? = nil, resources: [String]? = nil) {
            self.nextToken = nextToken
            self.resources = resources
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case resources = "Resources"
        }
    }

    public struct ListGroupsRequest: AWSEncodableShape {
        /// Specify this parameter to limit how many groups are returned each time you use the ListGroups operation. If you omit this parameter, the default of 20 is used.
        public let maxResults: Int?
        /// A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 512)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^.+$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListGroupsResponse: AWSDecodableShape {
        /// An array of structures that each contain information about one group.
        public let groups: [GroupSummary]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent ListGroups operation to retrieve the next  set of results.
        public let nextToken: String?

        public init(groups: [GroupSummary]? = nil, nextToken: String? = nil) {
            self.groups = groups
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case groups = "Groups"
            case nextToken = "NextToken"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn"))
        ]

        /// The ARN of the canary or group that you want to view tags for. The ARN format of a canary is arn:aws:synthetics:Region:account-id:canary:canary-name . The ARN format of a group is arn:aws:synthetics:Region:account-id:group:group-name
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:(canary|group):[0-9a-z_\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The list of tag keys and values associated with the resource that you specified.
        public let tags: [String: String]?

        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct RuntimeVersion: AWSDecodableShape {
        /// If this runtime version is deprecated, this value is the date of deprecation.
        public let deprecationDate: Date?
        /// A description of the runtime version, created by Amazon.
        public let description: String?
        /// The date that the runtime version was released.
        public let releaseDate: Date?
        /// The name of the runtime version. For a list of valid runtime versions,  see  Canary Runtime Versions.
        public let versionName: String?

        public init(deprecationDate: Date? = nil, description: String? = nil, releaseDate: Date? = nil, versionName: String? = nil) {
            self.deprecationDate = deprecationDate
            self.description = description
            self.releaseDate = releaseDate
            self.versionName = versionName
        }

        private enum CodingKeys: String, CodingKey {
            case deprecationDate = "DeprecationDate"
            case description = "Description"
            case releaseDate = "ReleaseDate"
            case versionName = "VersionName"
        }
    }

    public struct S3EncryptionConfig: AWSEncodableShape & AWSDecodableShape {
        ///  The encryption method to use for artifacts created by this canary. Specify SSE_S3 to use server-side encryption (SSE) with an Amazon S3-managed key. Specify SSE-KMS to use server-side encryption with a customer-managed KMS key. If you omit this parameter, an  Amazon Web Services-managed KMS key is used.
        public let encryptionMode: EncryptionMode?
        /// The ARN of the customer-managed KMS key to use, if you specify SSE-KMS for EncryptionMode
        public let kmsKeyArn: String?

        public init(encryptionMode: EncryptionMode? = nil, kmsKeyArn: String? = nil) {
            self.encryptionMode = encryptionMode
            self.kmsKeyArn = kmsKeyArn
        }

        public func validate(name: String) throws {
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, max: 2048)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, min: 1)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:kms:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:key/[\\w\\-\\/]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case encryptionMode = "EncryptionMode"
            case kmsKeyArn = "KmsKeyArn"
        }
    }

    public struct StartCanaryRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "name", location: .uri("Name"))
        ]

        /// The name of the canary that you want to run. To find canary names, use DescribeCanaries.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 21)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct StartCanaryResponse: AWSDecodableShape {
        public init() {}
    }

    public struct StopCanaryRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "name", location: .uri("Name"))
        ]

        /// The name of the canary that you want to stop. To find the names of your  canaries, use ListCanaries.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 21)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct StopCanaryResponse: AWSDecodableShape {
        public init() {}
    }

    public struct TagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn"))
        ]

        /// The ARN of the canary or group that you're adding tags to. The ARN format of a canary is
        /// arn:aws:synthetics:Region:account-id:canary:canary-name . The ARN format of a group is arn:aws:synthetics:Region:account-id:group:group-name
        public let resourceArn: String
        /// The list of key-value pairs to associate with the resource.
        public let tags: [String: String]

        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:(canary|group):[0-9a-z_\\-]+$")
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn")),
            AWSMemberEncoding(label: "tagKeys", location: .querystring("tagKeys"))
        ]

        /// The ARN of the canary or group that you're removing tags from. The ARN format of a canary is arn:aws:synthetics:Region:account-id:canary:canary-name .  The ARN format of a group is arn:aws:synthetics:Region:account-id:group:group-name
        public let resourceArn: String
        /// The list of tag keys to remove from the resource.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:(canary|group):[0-9a-z_\\-]+$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateCanaryRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "name", location: .uri("Name"))
        ]

        /// A structure that contains the configuration for canary artifacts,  including the encryption-at-rest settings for artifacts that  the canary uploads to Amazon S3.
        public let artifactConfig: ArtifactConfigInput?
        /// The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary.  Artifacts include the log file, screenshots, and HAR files. The name of the S3 bucket can't include a period (.).
        public let artifactS3Location: String?
        /// A structure that includes the entry point from which the canary should start running your script. If the script is stored in  an S3 bucket, the bucket name, key, and version are also included.
        public let code: CanaryCodeInput?
        /// The ARN of the IAM role to be used to run the canary. This role must already exist,  and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:    s3:PutObject     s3:GetBucketLocation     s3:ListAllMyBuckets     cloudwatch:PutMetricData     logs:CreateLogGroup     logs:CreateLogStream     logs:CreateLogStream
        public let executionRoleArn: String?
        /// The number of days to retain data about failed runs of this canary.
        public let failureRetentionPeriodInDays: Int?
        /// The name of the canary that you want to update. To find the names of your  canaries, use DescribeCanaries. You cannot change the name of a canary that has already been created.
        public let name: String
        /// A structure that contains the timeout value that is used for each individual run of the  canary.  The environment variables keys and values are not encrypted. Do not store sensitive information in this field.
        public let runConfig: CanaryRunConfigInput?
        /// Specifies the runtime version to use for the canary.   For a list of valid runtime versions and for more information about runtime versions, see  Canary Runtime Versions.
        public let runtimeVersion: String?
        /// A structure that contains information about how often the canary is to run, and when these runs are to stop.
        public let schedule: CanaryScheduleInput?
        /// The number of days to retain data about successful runs of this canary.
        public let successRetentionPeriodInDays: Int?
        /// Defines the screenshots to use as the baseline for comparisons during visual monitoring comparisons during future runs of this canary. If you omit this  parameter, no changes are made to any baseline screenshots that the canary might be using already. Visual monitoring is supported only on canaries running the syn-puppeteer-node-3.2 runtime or later. For more information, see  Visual monitoring and  Visual monitoring blueprint
        public let visualReference: VisualReferenceInput?
        /// If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint.  For more information, see  Running a Canary in a VPC.
        public let vpcConfig: VpcConfigInput?

        public init(artifactConfig: ArtifactConfigInput? = nil, artifactS3Location: String? = nil, code: CanaryCodeInput? = nil, executionRoleArn: String? = nil, failureRetentionPeriodInDays: Int? = nil, name: String, runConfig: CanaryRunConfigInput? = nil, runtimeVersion: String? = nil, schedule: CanaryScheduleInput? = nil, successRetentionPeriodInDays: Int? = nil, visualReference: VisualReferenceInput? = nil, vpcConfig: VpcConfigInput? = nil) {
            self.artifactConfig = artifactConfig
            self.artifactS3Location = artifactS3Location
            self.code = code
            self.executionRoleArn = executionRoleArn
            self.failureRetentionPeriodInDays = failureRetentionPeriodInDays
            self.name = name
            self.runConfig = runConfig
            self.runtimeVersion = runtimeVersion
            self.schedule = schedule
            self.successRetentionPeriodInDays = successRetentionPeriodInDays
            self.visualReference = visualReference
            self.vpcConfig = vpcConfig
        }

        public func validate(name: String) throws {
            try self.artifactConfig?.validate(name: "\(name).artifactConfig")
            try self.validate(self.artifactS3Location, name: "artifactS3Location", parent: name, max: 1024)
            try self.validate(self.artifactS3Location, name: "artifactS3Location", parent: name, min: 1)
            try self.code?.validate(name: "\(name).code")
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, max: 2048)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, min: 1)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$")
            try self.validate(self.failureRetentionPeriodInDays, name: "failureRetentionPeriodInDays", parent: name, max: 1024)
            try self.validate(self.failureRetentionPeriodInDays, name: "failureRetentionPeriodInDays", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 21)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
            try self.runConfig?.validate(name: "\(name).runConfig")
            try self.validate(self.runtimeVersion, name: "runtimeVersion", parent: name, max: 1024)
            try self.validate(self.runtimeVersion, name: "runtimeVersion", parent: name, min: 1)
            try self.schedule?.validate(name: "\(name).schedule")
            try self.validate(self.successRetentionPeriodInDays, name: "successRetentionPeriodInDays", parent: name, max: 1024)
            try self.validate(self.successRetentionPeriodInDays, name: "successRetentionPeriodInDays", parent: name, min: 1)
            try self.visualReference?.validate(name: "\(name).visualReference")
            try self.vpcConfig?.validate(name: "\(name).vpcConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case artifactConfig = "ArtifactConfig"
            case artifactS3Location = "ArtifactS3Location"
            case code = "Code"
            case executionRoleArn = "ExecutionRoleArn"
            case failureRetentionPeriodInDays = "FailureRetentionPeriodInDays"
            case runConfig = "RunConfig"
            case runtimeVersion = "RuntimeVersion"
            case schedule = "Schedule"
            case successRetentionPeriodInDays = "SuccessRetentionPeriodInDays"
            case visualReference = "VisualReference"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct UpdateCanaryResponse: AWSDecodableShape {
        public init() {}
    }

    public struct VisualReferenceInput: AWSEncodableShape {
        /// Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are  nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run  before this update was made, or the value of Id in the  CanaryRun from any past run of this canary.
        public let baseCanaryRunId: String
        /// An array of screenshots that will be used as the baseline for visual monitoring in future runs of this canary. If there is a screenshot that you don't want to be used for visual monitoring, remove it from this array.
        public let baseScreenshots: [BaseScreenshot]?

        public init(baseCanaryRunId: String, baseScreenshots: [BaseScreenshot]? = nil) {
            self.baseCanaryRunId = baseCanaryRunId
            self.baseScreenshots = baseScreenshots
        }

        public func validate(name: String) throws {
            try self.validate(self.baseCanaryRunId, name: "baseCanaryRunId", parent: name, max: 1024)
            try self.validate(self.baseCanaryRunId, name: "baseCanaryRunId", parent: name, min: 1)
            try self.baseScreenshots?.forEach {
                try $0.validate(name: "\(name).baseScreenshots[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case baseCanaryRunId = "BaseCanaryRunId"
            case baseScreenshots = "BaseScreenshots"
        }
    }

    public struct VisualReferenceOutput: AWSDecodableShape {
        /// The ID of the canary run that produced the baseline screenshots  that are used for visual monitoring comparisons by this canary.
        public let baseCanaryRunId: String?
        /// An array of screenshots that are used as the baseline for comparisons during visual monitoring.
        public let baseScreenshots: [BaseScreenshot]?

        public init(baseCanaryRunId: String? = nil, baseScreenshots: [BaseScreenshot]? = nil) {
            self.baseCanaryRunId = baseCanaryRunId
            self.baseScreenshots = baseScreenshots
        }

        private enum CodingKeys: String, CodingKey {
            case baseCanaryRunId = "BaseCanaryRunId"
            case baseScreenshots = "BaseScreenshots"
        }
    }

    public struct VpcConfigInput: AWSEncodableShape {
        /// The IDs of the security groups for this canary.
        public let securityGroupIds: [String]?
        /// The IDs of the subnets where this canary is to run.
        public let subnetIds: [String]?

        public init(securityGroupIds: [String]? = nil, subnetIds: [String]? = nil) {
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
        }

        public func validate(name: String) throws {
            try self.validate(self.securityGroupIds, name: "securityGroupIds", parent: name, max: 5)
            try self.validate(self.subnetIds, name: "subnetIds", parent: name, max: 16)
        }

        private enum CodingKeys: String, CodingKey {
            case securityGroupIds = "SecurityGroupIds"
            case subnetIds = "SubnetIds"
        }
    }

    public struct VpcConfigOutput: AWSDecodableShape {
        /// The IDs of the security groups for this canary.
        public let securityGroupIds: [String]?
        /// The IDs of the subnets where this canary is to run.
        public let subnetIds: [String]?
        /// The IDs of the VPC where this canary is to run.
        public let vpcId: String?

        public init(securityGroupIds: [String]? = nil, subnetIds: [String]? = nil, vpcId: String? = nil) {
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
            self.vpcId = vpcId
        }

        private enum CodingKeys: String, CodingKey {
            case securityGroupIds = "SecurityGroupIds"
            case subnetIds = "SubnetIds"
            case vpcId = "VpcId"
        }
    }
}

// MARK: - Errors

/// Error enum for Synthetics
public struct SyntheticsErrorType: AWSErrorType {
    enum Code: String {
        case badRequestException = "BadRequestException"
        case conflictException = "ConflictException"
        case internalFailureException = "InternalFailureException"
        case internalServerException = "InternalServerException"
        case notFoundException = "NotFoundException"
        case requestEntityTooLargeException = "RequestEntityTooLargeException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case tooManyRequestsException = "TooManyRequestsException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize Synthetics
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// The request was not valid.
    public static var badRequestException: Self { .init(.badRequestException) }
    /// A conflicting operation is already in progress.
    public static var conflictException: Self { .init(.conflictException) }
    /// An internal failure occurred. Try the operation again.
    public static var internalFailureException: Self { .init(.internalFailureException) }
    /// An unknown internal error occurred.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// The specified resource was not found.
    public static var notFoundException: Self { .init(.notFoundException) }
    /// One of the input resources is larger than is allowed.
    public static var requestEntityTooLargeException: Self { .init(.requestEntityTooLargeException) }
    /// One of the specified resources was not found.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// The request exceeded a service quota value.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    /// There were too many simultaneous requests. Try the operation again.
    public static var tooManyRequestsException: Self { .init(.tooManyRequestsException) }
    /// A parameter could not be validated.
    public static var validationException: Self { .init(.validationException) }
}

extension SyntheticsErrorType: Equatable {
    public static func == (lhs: SyntheticsErrorType, rhs: SyntheticsErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension SyntheticsErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
